home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2002 November / CD 1 / APC0211D1.ISO / workshop / prog / files / ActivePerl-5.6.1.633-MSWin32.msi / _cd6ef2c16faa5d7fd7dd05febb6b9557 < prev    next >
Encoding:
Text File  |  2002-06-17  |  3.6 KB  |  141 lines

  1. /*
  2.  * tkWinPort.h --
  3.  *
  4.  *    This header file handles porting issues that occur because of
  5.  *    differences between Windows and Unix. It should be the only
  6.  *    file that contains #ifdefs to handle different flavors of OS.
  7.  *
  8.  * Copyright (c) 1995-1996 Sun Microsystems, Inc.
  9.  * Copyright (c) 1998 by Scriptics Corporation.
  10.  *
  11.  * See the file "license.terms" for information on usage and redistribution
  12.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  13.  *
  14.  * RCS: @(#) $Id: tkWinPort.h,v 1.3 1998/09/30 19:01:22 rjohnson Exp $
  15.  */
  16.  
  17. #ifndef _WINPORT
  18. #define _WINPORT
  19. #define NEED_REAL_STDIO
  20. #include <X11/Xlib.h>
  21. #include <X11/cursorfont.h>
  22. #include <X11/keysym.h>
  23. #include <X11/Xatom.h>
  24. #include <X11/Xutil.h>
  25.  
  26. #include <errno.h>
  27. #include <ctype.h>
  28. #include <math.h>
  29. #include <stdlib.h>
  30. #include <string.h>
  31. #include <limits.h>
  32. #include <fcntl.h>
  33. #include <io.h>
  34. #ifdef __EMX__
  35. #   include <sys/types.h>
  36. #endif
  37. #include <sys/stat.h>
  38. #include <sys/timeb.h>
  39. #include <time.h>
  40.  
  41. #ifdef _MSC_VER
  42. #    define hypot _hypot
  43. #else /* _MSC_VER */
  44. #    ifdef __EMX__
  45. #        define strncasecmp strnicmp
  46. #    endif
  47. #endif /* _MSC_VER */
  48.  
  49. #define strncasecmp strnicmp
  50. #define strcasecmp stricmp
  51.  
  52. #define NBBY 8
  53.  
  54. #define OPEN_MAX 32
  55.  
  56. /*
  57.  * The following define causes Tk to use its internal keysym hash table
  58.  */
  59.  
  60. #define REDO_KEYSYM_LOOKUP
  61.  
  62. /*
  63.  * The following macro checks to see whether there is buffered
  64.  * input data available for a stdio FILE.
  65.  */
  66.  
  67. #ifdef _MSC_VER
  68. #    define TK_READ_DATA_PENDING(f) ((f)->_cnt > 0)
  69. #else /* _MSC_VER */
  70. #    define TK_READ_DATA_PENDING(f) ((f)->level > 0)
  71. #endif /* _MSC_VER */
  72.  
  73. /*
  74.  * The following stubs implement various calls that don't do anything
  75.  * under Windows.
  76.  */
  77.  
  78. #define TkFreeWindowId(dispPtr,w)
  79. #define TkInitXId(dispPtr)
  80. #define TkpCmapStressed(tkwin,colormap) (0)
  81. #define XFlush(display)
  82. #define XGrabServer(display)
  83. #define XUngrabServer(display)
  84. #define TkpSync(display)
  85.  
  86. /*
  87.  * The following functions are implemented as macros under Windows.
  88.  */
  89.  
  90. #define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}
  91. #define XNoOp(display) {display->request++;}
  92. #define XSynchronize(display, bool) {display->request++;}
  93. #define XSync(display, bool) {display->request++;}
  94. #define XVisualIDFromVisual(visual) (visual->visualid)
  95.  
  96. /* Additional translations needed for Tk extensions (Pixmap). */
  97.  
  98. #define XPutImage(display, dr, gc, i, a, b, c, d, e, f) \
  99.     TkPutImage(NULL, 0, display, dr, gc, i, a, b, c, d, e, f)
  100. #define XDefaultVisual(display, screen) ((screen)->root_visual)
  101. #define XDefaultScreen(display) ((display)->screens)
  102. #define XDefaultColormap(display, screen) ((screen)->cmap)
  103. #define XDefaultDepth(display, screen) ((screen)->root_depth)
  104.  
  105. /*
  106.  * The following Tk functions are implemented as macros under Windows.
  107.  */
  108.  
  109. #define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \
  110.     | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000)
  111.  
  112. /*
  113.  * These calls implement native bitmaps which are not currently
  114.  * supported under Windows.  The macros eliminate the calls.
  115.  */
  116.  
  117. #define TkpDefineNativeBitmaps()
  118. #define TkpCreateNativeBitmap(display, source) None
  119. #define TkpGetNativeAppBitmap(display, name, w, h) None
  120.  
  121. /*
  122.  * Define timezone for gettimeofday.
  123.  */
  124. #if 0
  125. struct timezone {
  126.     int tz_minuteswest;
  127.     int tz_dsttime;
  128. };
  129. #else
  130. #undef timezone
  131. struct timezone;
  132. struct timeval;
  133. #endif
  134.  
  135. extern int gettimeofday(struct timeval *, struct timezone *);
  136. #if 0
  137. EXTERN void        panic _ANSI_ARGS_(TCL_VARARGS(char *,format));
  138. #endif
  139.  
  140. #endif /* _WINPORT */
  141.